package com.ruoyi.ResBanner.service.impl;

import com.ruoyi.ResBanner.domain.ResBanner;
import com.ruoyi.ResBanner.mapper.ResBannerMapper;
import com.ruoyi.ResBanner.service.ResBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
@Service
public class ResBannerServiceImpl implements ResBannerService {

    @Autowired
    ResBannerMapper resBannerMapper;

    @Override
    public List<ResBanner> selectShopByIf(ResBanner resBanner){
        return resBannerMapper.selectBannerByIf(resBanner);
    }

    @Override
    public int insertResBanner(ResBanner resBanner){
        resBanner.setCreate_time(new Date());
        return resBannerMapper.insertNewresBanner(resBanner);
    }

    @Override
    public int updateResBanner(ResBanner resBanner) {
        resBanner.setUpdate_time(new Date());
        return resBannerMapper.updateNewresBanner(resBanner);
    }

    @Override
    public int deleteResBanner(int id) {
        return resBannerMapper.deleteNewresBanner(id);
    }
}
